package com.wpml.designmode.strategy;

import java.util.Arrays;
import java.util.concurrent.ThreadLocalRandom;

/**
 * @Description 策略设计模式原则    对修改关闭，对扩展开发
 * @Date 2021-05-14
 * @Author wangpei
 **/
public class Main {

    public static void main(String[] args) {
        /*Cat[] arr = {new Cat(1,3),new Cat(5,5),new Cat(3,1)};

        Sorter<Cat> sorter = new Sorter<>();

        sorter.sort(arr, (o1, o2) -> Integer.compare(o1.weight, o2.weight));++++++++++++

        System.out.println(Arrays.toString(arr));

        sorter.sort(arr, (o1, o2) -> Integer.compare(o1.height, o2.height));

        sorter.sort(arr, (o1,o2) -> Integer.compare(o1.height, o2.height));

        System.out.println(Arrays.toString(arr));*/


        System.out.println(ThreadLocalRandom.current().nextInt(100000, 999999));
    }
}
